#ifndef _H_S_PROTOCOL_SERVER_POINT_H_
#define _H_S_PROTOCOL_SERVER_POINT_H_

#include "SProtocolServer.h"

namespace QWER
{
	QDLL_EXPORT QSTRUCT SProtocolServerPoint
	{
	public:
#ifndef _USING_CLI
		SProtocolServerPoint() {}
#endif
		SProtocolServerPoint(CONST_REF(SProtocolServer) sAddress, UINT16 wURI):
			m_sAddress(sAddress), m_wURI(wURI)
		{
		}

		inline CONST_REF(SProtocolServer) GetServer() QCONST_FUNC { return m_sAddress; }
		inline UINT16 GetURI() QCONST_FUNC { return m_wURI; }

	private:
		QINIT_ONLY SProtocolServer m_sAddress;
		QINIT_ONLY UINT16 STRUCT_MEMBER_DEFINE(m_wURI, 0);
	};
}

namespace std
{
    template <>
    struct hash<QWER::SProtocolServerPoint>
    {
    public:
        std::size_t operator()(const QWER::SProtocolServerPoint& c) const
        {
            return m_oHash(c.GetServer() | ((UINT64)(c.GetURI()) << 48));
        }

    private:
        std::hash<UINT64> m_oHash;
	};
}

#endif
